package com.aiju.cash.ui.setting;

import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.aiju.app.config.ConfigManager;
import com.aiju.base.activity.BaseTitleActivity;
import com.aiju.cash.R;
import com.aiju.utils.L;

/**
 * @author: 佐为
 * @date: 2016-12-19 17:52
 * @version: V1.0
 * @Description: 费率
 */
public class RateInfoActivity extends BaseTitleActivity {

    private String remark;

    private WebView webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rate_info);
        setCenterTitle("费率说明");
        remark = ConfigManager.INIT_SERVER_HOST + "/dealRate/remark?" + "token=" + mUser.getToken();
        webView = (WebView) findViewById(R.id.webView);
        //WebView加载web资源
        L.d(remark);
        webView.loadUrl(remark);
        //覆盖WebView默认使用第三方或系统默认浏览器打开网页的行为，使网页用WebView打开
        webView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                // TODO Auto-generated method stub
                //返回值是true的时候控制去WebView打开，为false调用系统浏览器或第三方浏览器
                view.loadUrl(url);
                return true;
            }
        });
    }
}
